	
<?
$img_path = 'upload/images/';
$code = isset($_REQUEST['sub']) ? $_REQUEST['sub'] : 'hinhanh';
if ($code == "hinhanh")		//cho phan khai giang
{?>
	<div class="titledetaillist">Thư viện hình ảnh</div>
	<?php
		//lay thong tin ve cac album dua len
		$sql1 = "select b.id as albid, b.name as albname,  a.file from tbl_image a, tbl_album b where a.album = b.id and daidien=1";
		$result = @mysql_query($sql1,$conn);
		$num=mysql_num_rows($result);
		if($num==0){?>
			<table width="100%" border="0" cellspacing="0" cellpadding="0">
			<tr><td align="center"><font color="#FF0000" size="2">Hiện chưa có album nào ...</font></td></tr>
			</table>
		<?} 
		else 
		{
			while($row=mysql_fetch_assoc($result))
			{
				//dem so luong hinh trong album
				$sql2 = "select * from tbl_image where album = ".$row['albid'];
				$result2 = @mysql_query($sql2, $conn);
				$num2 = mysql_num_rows($result2);
		?>
        <div class="anewstop">
              <div class="picdetailleft"><a href="/?frame=alb&alb=<?=$row['albid']?>"><img src="<?=$img_path.$row['file']?>" width="216" height="144" border="0" /></a></div>
                <div class="title"><a href="/?frame=alb&alb=<?=$row['albid']?>"><?=$row['albname']?></a></div>
              	<div class="time"><img src="Images/communication_32.png" width="32" height="32" align="absmiddle" /> =so luong comment cho album hay tong cm of anh???</div>
                
                <div class="module">
                  <strong>Số lượng ảnh</strong>: <?=$num2?> <br />
                  <strong>Số lần xem album</strong>: ??? = moi lan click vao album? <br />
                  <strong>Nơi chụp</strong>: ??? nen dua vao?<br />
                <strong>Chia sẻ</strong>: ??? co nen?                
                </div><!--endcontent-->
          <div class=""><input name="" type="button" class="btnlike" value="Like"/> <a href="#">2 member like this</a></div>
               <div class="btright"><a href="" class="submit"><input name="" type="submit" value="Download" /></a></div> 
              <div id="clearone"></div>                              
   	  </div><!--endanews-->
        <?
			}
		?>
            <div class="pages"> Trang 1/20
                   	<a href="#" title="Trang trước"><img src="Images/FirstPage.gif" width="12" height="12" border="0" align="baseline" /></a><a href="#">1</a><a href="#">2</a><a href="#">3</a><a href="#" title="Trang sau"><img src="Images/LastPage.gif" width="12" height="12" border="0" align="baseline" /></a></div>
<? 
		} 
}
?>  	  